Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(opentrons-ai-client): add conditional for user prompt #15308

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

koji
Copy link
Contributor

@koji koji commented May 31, 2024

Overview

add conditional for user prompt

before

Screenshot 2024-05-31 at 3 36 48 PM

after

Screenshot 2024-05-31 at 3 50 45 PM

close AUTH-433

Test Plan

Changelog

Review requests

Risk assessment

@koji koji marked this pull request as ready for review May 31, 2024 19:53
@koji koji requested a review from a team as a code owner May 31, 2024 19:53
Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i get this error from react markdown when using one of the example buttons:

Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Screenshot 2024-05-31 at 4 34 32 PM

@shlokamin
Copy link
Member

i don't think react markdown likes undefined

@koji
Copy link
Contributor Author

koji commented May 31, 2024

i don't think react markdown likes undefined

change undefined to paragraph text.

@koji koji requested a review from shlokamin May 31, 2024 20:49
@Elyorcv
Copy link
Contributor

Elyorcv commented Jun 3, 2024

i don't think react markdown likes undefined

change undefined to paragraph text.

does it behave differently for user vs. assistant?

@koji
Copy link
Contributor Author

koji commented Jun 3, 2024

i don't think react markdown likes undefined

change undefined to paragraph text.

does it behave differently for user vs. assistant?

yes because of conditional rendering.

Copy link
Contributor

@Elyorcv Elyorcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not behaving correctly. See the image below, when user sends info with backtick, it renders as a block.


Write a protocol using the Opentrons Python Protocol API v2 for OT-2 robot according to the following description:
  
Labware:
- Source Labware: `Thermo Scientific Nunc 96 Well Plate 1300 uL` in slot 9
- Destination Labware: `Opentrons 96 Flat Bottom Adapter with NEST 96 Well Plate 200 uL Flat` in slot 10
- `Opentrons 96 Filter Tip Rack 1000 uL` in slot 8
- `Opentrons 96 Tip Rack 1000 uL` in slot 3

Pipette mount:
- P1000 Single-Channel GEN2 is mounted on the left
- P1000 Single-Channel GEN2 is mounted on the right

Commands:
1. Use the left-mounted P1000 Single-Channel GEN2 pipette to transfer 196 uL of reagent from wells A7, A6, A5, A2, A3 
of the source labware to the corresponding wells A5, A9, A1, A10, A2 of the destination labware. Use a new tip for each transfer.
2. Use the right-mounted P1000 Single-Channel GEN2 pipette to transfer 8 uL of liquid from wells A9, A12, A6, A10, A3 
of the source labware to the corresponding wells A7, A11, A6, A3, A9 of the destination labware. Use the same tip for all transfers.

image

@koji
Copy link
Contributor Author

koji commented Jun 3, 2024

No it is not behaving correctly. See the image below, when user sends info with backtick, it renders as a block.


Write a protocol using the Opentrons Python Protocol API v2 for OT-2 robot according to the following description:
  
Labware:
- Source Labware: `Thermo Scientific Nunc 96 Well Plate 1300 uL` in slot 9
- Destination Labware: `Opentrons 96 Flat Bottom Adapter with NEST 96 Well Plate 200 uL Flat` in slot 10
- `Opentrons 96 Filter Tip Rack 1000 uL` in slot 8
- `Opentrons 96 Tip Rack 1000 uL` in slot 3

Pipette mount:
- P1000 Single-Channel GEN2 is mounted on the left
- P1000 Single-Channel GEN2 is mounted on the right

Commands:
1. Use the left-mounted P1000 Single-Channel GEN2 pipette to transfer 196 uL of reagent from wells A7, A6, A5, A2, A3 
of the source labware to the corresponding wells A5, A9, A1, A10, A2 of the destination labware. Use a new tip for each transfer.
2. Use the right-mounted P1000 Single-Channel GEN2 pipette to transfer 8 uL of liquid from wells A9, A12, A6, A10, A3 
of the source labware to the corresponding wells A7, A11, A6, A3, A9 of the destination labware. Use the same tip for all transfers.
image

not completely align with that since we use react-mark down and it take some time.
this pr is to fix the margin and no black background in user prompt.

https://opentrons.slack.com/archives/C074KKV6SRK/p1717189125167839

@Elyorcv
Copy link
Contributor

Elyorcv commented Jun 3, 2024

No it is not behaving correctly. See the image below, when user sends info with backtick, it renders as a block.


Write a protocol using the Opentrons Python Protocol API v2 for OT-2 robot according to the following description:
  
Labware:
- Source Labware: `Thermo Scientific Nunc 96 Well Plate 1300 uL` in slot 9
- Destination Labware: `Opentrons 96 Flat Bottom Adapter with NEST 96 Well Plate 200 uL Flat` in slot 10
- `Opentrons 96 Filter Tip Rack 1000 uL` in slot 8
- `Opentrons 96 Tip Rack 1000 uL` in slot 3

Pipette mount:
- P1000 Single-Channel GEN2 is mounted on the left
- P1000 Single-Channel GEN2 is mounted on the right

Commands:
1. Use the left-mounted P1000 Single-Channel GEN2 pipette to transfer 196 uL of reagent from wells A7, A6, A5, A2, A3 
of the source labware to the corresponding wells A5, A9, A1, A10, A2 of the destination labware. Use a new tip for each transfer.
2. Use the right-mounted P1000 Single-Channel GEN2 pipette to transfer 8 uL of liquid from wells A9, A12, A6, A10, A3 
of the source labware to the corresponding wells A7, A11, A6, A3, A9 of the destination labware. Use the same tip for all transfers.
image

not completely align with that since we use react-mark down and it take some time. this pr is to fix the margin and no black background in user prompt.

https://opentrons.slack.com/archives/C074KKV6SRK/p1717189125167839

black background is coming from rendering of backtick. Although it is not black anymore, the backtick is still considered as a block rather than inline. Maybe we need to change this PR to account for only fixing margin.

@koji
Copy link
Contributor Author

koji commented Jun 3, 2024

No it is not behaving correctly. See the image below, when user sends info with backtick, it renders as a block.


Write a protocol using the Opentrons Python Protocol API v2 for OT-2 robot according to the following description:
  
Labware:
- Source Labware: `Thermo Scientific Nunc 96 Well Plate 1300 uL` in slot 9
- Destination Labware: `Opentrons 96 Flat Bottom Adapter with NEST 96 Well Plate 200 uL Flat` in slot 10
- `Opentrons 96 Filter Tip Rack 1000 uL` in slot 8
- `Opentrons 96 Tip Rack 1000 uL` in slot 3

Pipette mount:
- P1000 Single-Channel GEN2 is mounted on the left
- P1000 Single-Channel GEN2 is mounted on the right

Commands:
1. Use the left-mounted P1000 Single-Channel GEN2 pipette to transfer 196 uL of reagent from wells A7, A6, A5, A2, A3 
of the source labware to the corresponding wells A5, A9, A1, A10, A2 of the destination labware. Use a new tip for each transfer.
2. Use the right-mounted P1000 Single-Channel GEN2 pipette to transfer 8 uL of liquid from wells A9, A12, A6, A10, A3 
of the source labware to the corresponding wells A7, A11, A6, A3, A9 of the destination labware. Use the same tip for all transfers.
image

not completely align with that since we use react-mark down and it take some time. this pr is to fix the margin and no black background in user prompt.
https://opentrons.slack.com/archives/C074KKV6SRK/p1717189125167839

black background is coming from rendering of backtick. Although it is not black anymore, the backtick is still considered as a block rather than inline. Maybe we need to change this PR to account for only fixing margin.

because the response from backend includes pre tag(backtick)

What this pr does

  • adding padding to li (this is obvious when the li item's number is more than 10 attached the image in overvew)
  • not displaying black background in user prompt
response.mov

@koji koji requested a review from Elyorcv June 3, 2024 18:20
Copy link
Contributor

@Elyorcv Elyorcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I created another ticket to solve backtick rendering https://opentrons.atlassian.net/browse/AUTH-465

@koji koji merged commit 2fb1cbd into edge Jun 3, 2024
8 checks passed
@koji koji deleted the fix_AUTH-433-chat-display-for-user branch June 3, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants